﻿using System;
using System.Windows.Forms;

namespace DotNetBurner.LiveWriterPlugIn
{
    public partial class Options : Form
    {
        private readonly Settings _settings;

        internal Options(Settings settings)
            : this()
        {
            _settings = settings;
        }

        public Options()
        {
            InitializeComponent();
        }

        private void BtnOk_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void chkDNSO_CheckedChanged(object sender, EventArgs e)
        {
            _settings.EnableDotNetShoutOut = ((CheckBox)sender).Checked;
        }

        private void chkDNK_CheckedChanged(object sender, EventArgs e)
        {
            _settings.EnableDotNetKicks = ((CheckBox)sender).Checked;
        }

        private void chkDNB_CheckedChanged(object sender, EventArgs e)
        {
            _settings.EnableDotNetBurner = ((CheckBox)sender).Checked;
        }

        private void chkWDV_CheckedChanged(object sender, EventArgs e)
        {
            _settings.EnableWebDevVote = ((CheckBox)sender).Checked;
        }

        private void Options_Load(object sender, EventArgs e)
        {
            chkDNB.Checked = _settings.EnableDotNetBurner;
            chkDNK.Checked = _settings.EnableDotNetKicks;
            chkDNSO.Checked = _settings.EnableDotNetShoutOut;
            chkWDV.Checked = _settings.EnableWebDevVote;
        }
    }
}
